//
//  SZRecommendDetailViewController.m
//  KaiJing
//
//  Created by lanou on 16/1/20.
//  Copyright © 2016年 HuangZuCui. All rights reserved.
//

#import "SZRecommendDetailViewController.h"
#import "PKRequestManager.h"

@interface SZRecommendDetailViewController ()
@property (nonatomic, strong) UIWebView *webView;
@end

@implementation SZRecommendDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    _webView = [[UIWebView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
    [self.view addSubview:_webView];
    
    [self setupData];
}

- (void)setupData {
    NSString *urlString = [NSString stringWithFormat:@"http://news-at.zhihu.com/api/4/story/%@",_ID];
    [PKRequestManager requestWithUrlString:urlString parDic:nil method:GET finish:^(NSDictionary *dataDic) {
        NSURL *url = [NSURL URLWithString:dataDic[@"share_url"]];
        [_webView loadRequest:[NSURLRequest requestWithURL:url]];
    } error:^(NSError *error) {
        SZLog(@"%@",error);
    }];
}



@end
